<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="Bookmark" href="/favicon.ico">
    <link rel="Shortcut Icon" href="/favicon.ico" />
    <!--[if lt IE 9]>
                <script type="text/javascript" src="lib/html5shiv.js"></script>
                <script type="text/javascript" src="lib/respond.min.js"></script>
                <![endif]-->
    <link rel="stylesheet" type="text/css" href="../static/h-ui/css/H-ui.min.css" />
    <link rel="stylesheet" type="text/css" href="../static/h-ui.admin/css/H-ui.admin.css" />
    <link rel="stylesheet" type="text/css" href="../lib/Hui-iconfont/1.0.8/iconfont.css" />
    <link rel="stylesheet" type="text/css" href="../static/h-ui.admin/skin/default/skin.css" id="skin" />
    <link rel="stylesheet" type="text/css" href="../static/h-ui.admin/css/style.css" />
    <link rel="stylesheet" href="./../lib/layui/css/layui.css">
    <!--[if IE 6]>
                <script type="text/javascript" src="lib/DD_belatedPNG_0.0.8a-min.js" ></script>
                <script>DD_belatedPNG.fix('*');</script>
                <![endif]-->
    <title>充值</title>
</head>

<body>
    <nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 提现管理 <span
            class="c-gray en">&gt;</span>
        充值 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);"
            title="刷新"><i class="Hui-iconfont">&#xe68f;</i></a></nav>
    <div class="page-container" style="margin-left: 30%" >
        <!-- 暂时不需要，注释 -->
        <!-- <div class="row cl" style="margin-top:10px;">
            <label class="form-label col-xs-2 col-sm-2">充值类型：</label>
            <div class="formControls col-xs-5 col-sm-5">
                <select type="text" class="input-text" value="" placeholder="" id="status" name="">
                    <option value="">购物金</option>
                    <option value="1">美豆</option>
                </select>
            </div>
        </div> -->
        <div class="row cl" style="margin-top:10px;">
            <label class="form-label col-xs-2 col-sm-2">充值账号：</label>
            <div class="formControls col-xs-5 col-sm-5">
                <input type="text" class="input-text" value="" placeholder="" id="mobile" name="">
            </div>
        </div>
        <div class="row cl" style="margin-top:10px;">
            <label class="form-label col-xs-2 col-sm-2">充值金额：</label>
            <div class="formControls col-xs-5 col-sm-5">
                <input type="number" style = "width:100%" class="input-text" value="" placeholder="" id="recharge" name="">
            </div>
        </div>
        <div class="row cl">
            <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2" style="margin-bottom:20px;margin-top:10px">
                <div onClick="rechargeMoney();" class="btn btn-primary radius" id="save">充值</div>
            </div>
        </div>
    </div>
    <script type="text/javascript" src="../lib/jquery/1.9.1/jquery.min.js"></script>
    <script type="text/javascript" src="./../static/js/common.js"></script>
    <script type="text/javascript" src="../lib/layer/2.4/layer.js"></script>
    <script type="text/javascript" src="../static/h-ui/js/H-ui.min.js"></script>
    <script type="text/javascript" src="../static/h-ui.admin/js/H-ui.admin.js"></script>
    <script type="text/javascript" src="./../lib/layui/layui.js"></script>
    <script>
        function rechargeMoney() {
            if ($("#mobile").val() == '') {
                layer.msg("请输入充值账户")
            } else if ($("#recharge").val() == '') {
                layer.msg("请输入充值金额")
            } else {
                // 可用美豆和购物金充值，暂时注释。。
                // if($("#status option:selected").val() == ''){
                //     var mobile = $("#mobile").val(),
                //     recharge = $("#recharge").val();
                // $.ajax({
                //     type: "post",
                //     xhrFields: {
                //         withCredentials: true
                //     },
                //     url: admin_url + '/kvmAccount/accountRecharge',
                //     data: {
                //         tokenUserId: userId,
                //         token: token,
                //         mobile: mobile,
                //         num: recharge
                //     },
                //     success:function(data){
                //         if (data.code == 200) {
                //         layer.msg('充值成功', {
                //             time: 1000,
                //             end: function () {
                //                 location.replace(location.href)
                //             }
                //         })
                //     } else {
                //         layer.msg(data.msg, {
                //             time: 1500
                //         })
                //     }
                //     }
                    
                // })
                // }else if($("#status option:selected").val() == 1){
                //     var mobile = $("#mobile").val(),
                //     recharge = $("#recharge").val();
                // $.ajax({
                //     type: "post",
                //     xhrFields: {
                //         withCredentials: true
                //     },
                //     url: admin_url + '/kvmAccount/accountRecharge',
                //     data: {
                //         tokenUserId: userId,
                //         token: token,
                //         mobile: mobile,
                //         num: recharge,
                //         type:$("#status option:selected").val()
                //     },
                //     success:function(data){
                //         if (data.code == 200) {
                //         layer.msg('充值成功', {
                //             time: 1000,
                //             end: function () {
                //                 location.replace(location.href)
                //             }
                //         })
                //     } else {
                //         layer.msg(data.msg, {
                //             time: 1500
                //         })
                //     }
                //     }
                    
                // })
                // }
                var mobile = $("#mobile").val(),
                    recharge = $("#recharge").val();
                $.ajax({
                    type: "post",
                    xhrFields: {
                        withCredentials: true
                    },
                    url: admin_url + '/kvmAccount/accountRecharge',
                    data: {
                        tokenUserId: userId,
                        token: token,
                        mobile: mobile,
                        num: recharge
                    },
                    success:function(data){
                        if (data.code == 200) {
                        layer.msg('充值成功', {
                            time: 1000,
                            end: function () {
                                location.replace(location.href)
                            }
                        })
                    } else {
                        layer.msg(data.msg, {
                            time: 1500
                        })
                    }
                    }
                    
                })
            }
        }
    </script>
</body>

</html>